home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / linklist / source.lha / patch1 < prev    next >
Text File  |  1993-08-08  |  50KB  |  2,152 lines

  1. *** ../CHANGES    Wed May 19 15:57:55 1993
  2. --- CHANGES    Wed May 19 15:39:41 1993
  3. ***************
  4. *** 1,5 ****
  5. ! Most important changes from version 0.7 to version 0.8 :
  6.   
  7.   -    Routine lIndxNode is renamed to lGetIndxNode.
  8.   
  9.   -    Routine lFlagNode is renamed to lFndFlagNode.
  10. --- 1,16 ----
  11. ! Most important changes from version 0.8 to version 0.9 (May 1993) :
  12.   
  13. + -    Bug solved in the heap sorting algorithm.
  14. + -    Ported to Amiga by James Diffendaffer.
  15. + -    Some additional porting solutions for Borland and other MSDOS C
  16. +     compilers by Shane Brath).
  17. + --------------------------------------------------------------------------------
  18. + Most important changes from version 0.7 to version 0.8 (March 1993) :
  19.   -    Routine lIndxNode is renamed to lGetIndxNode.
  20.   
  21.   -    Routine lFlagNode is renamed to lFndFlagNode.
  22. ***************
  23. *** 10,12 ****
  24. --- 21,67 ----
  25.       lSort.
  26.   
  27.   -    Defines are made more specific; FIRST is renamed to lFIRST, etc.
  28. + --------------------------------------------------------------------------------
  29. + Most important changes from version 0.6 to version 0.7 (March 1992) :
  30. + -    Ported to Macintosh by Vincent van Gentevoort.
  31. + -    New routine 'lFlagNode'.
  32. + --------------------------------------------------------------------------------
  33. + Most important changes from version 0.5 to version 0.6 (December 1991) :
  34. + -    Ported to VAX/VMS by Anita Eijs & Rene Balkenende.
  35. + --------------------------------------------------------------------------------
  36. + Most important changes from version 0.4 to version 0.5  (February 1991) :
  37. + -    Return type for each routine.
  38. + --------------------------------------------------------------------------------
  39. + Most important changes from version 0.3 to version 0.4 (November 1990) :
  40. + -    New routines 'lDump' and 'lUndump'.
  41. + --------------------------------------------------------------------------------
  42. + Most important changes from version 0.2 to version 0.3 (September 1990) :
  43. + -    New routine 'lError'.
  44. + --------------------------------------------------------------------------------
  45. + Most important changes from version 0.1 to version 0.2 (April 1990) :
  46. + -    New routine 'lIndxNode'.
  47. + --------------------------------------------------------------------------------
  48. + Version 0.1 (May 1989) :
  49. + -    Created by Anita Eijs, TNO-BOUW, BouwInformatica.
  50. *** ../README    Mon May  3 12:58:56 1993
  51. --- README    Tue May 25 15:23:21 1993
  52. ***************
  53. *** 2,8 ****
  54.                   ===================
  55.   
  56.   
  57. ! The distribution of the Generic Linked List package (Version 0.8, May 1993)
  58.   includes the following files:
  59.   
  60.       Doc/Intro.3        - [nt]roff manual pages
  61. --- 2,8 ----
  62.                   ===================
  63.   
  64.   
  65. ! The distribution of the Generic Linked List package (Version 0.9, May 1993)
  66.   includes the following files:
  67.   
  68.       Doc/Intro.3        - [nt]roff manual pages
  69. ***************
  70. *** 26,31 ****
  71. --- 26,34 ----
  72.       Doc/lUpdNode.3
  73.       Makefile        - Berkeley or System V Makefile
  74.       Makefile.BCC        - Borland C++ v3.1 Makefile
  75. +     ReadMe.BCC        - some additional info about Borland port
  76. +     Makefile.Amiga        - Amiga SAS C 6.0 Makefile
  77. +     ReadMe.Amiga        - some additional info about Amiga port
  78.       README            - this file !
  79.       CHANGES            - list of changes
  80.       Tools_makerule        - make rules for Makefile
  81. ***************
  82. *** 43,51 ****
  83.   
  84.   2)    Check the environment settings (RANLIB) in the Tools_makerule.
  85.   
  86. ! 3)    Enter 'make newlib' at the UNIX prompt.
  87.   
  88. ! 4)    Enter 'make test' or 'make example' to create the executable of
  89.       the program 'example' at the UNIX prompt.
  90.   
  91.   
  92. --- 46,56 ----
  93.   
  94.   2)    Check the environment settings (RANLIB) in the Tools_makerule.
  95.   
  96. ! 3)    Be sure that the LIB-directory is created.
  97.   
  98. ! 4)    Enter 'make newlib' at the UNIX prompt.
  99. ! 5)    Enter 'make test' or 'make example' to create the executable of
  100.       the program 'example' at the UNIX prompt.
  101.   
  102.   
  103. ***************
  104. *** 55,63 ****
  105.   
  106.   
  107.   The Generic Linked List is in the public domain. It is available at our FTP
  108. ! archive (ftp.tno.nl or hermes.bouw.tno.nl), just retrieve te files :
  109. !     /pub/TNO/BOUW/Bouwinf/linkedlist_0.8.README
  110. !     /pub/TNO/BOUW/Bouwinf/linkedlist_0.8.shar
  111.   
  112.   
  113.   If you have any comments, suggestions, or find any bugs, or make any changes
  114. --- 60,68 ----
  115.   
  116.   
  117.   The Generic Linked List is in the public domain. It is available at our FTP
  118. ! archive (ftp.tno.nl or hermes.bouw.tno.nl), just retrieve the files :
  119. !     /pub/TNO/BOUW/Bouwinf/linkedlist_0.9.README
  120. !     /pub/TNO/BOUW/Bouwinf/linkedlist_0.9.shar
  121.   
  122.   
  123.   If you have any comments, suggestions, or find any bugs, or make any changes
  124. ***************
  125. *** 69,72 ****
  126.   P.O. Box 49
  127.   2600 AA Delft
  128.   The Netherlands
  129. ! FAX : +31 15 843990
  130. --- 74,77 ----
  131.   P.O. Box 49
  132.   2600 AA Delft
  133.   The Netherlands
  134. ! FAX : +31 15 122182
  135. *** ../example.c    Fri Feb 26 09:04:13 1993
  136. --- example.c    Fri May 21 09:58:14 1993
  137. ***************
  138. *** 1,3 ****
  139. --- 1,7 ----
  140. + #ifdef    AMIGA
  141. + #include        <string.h>
  142. + #endif
  143.   #include        <stdio.h>
  144.   #include        "list.h"
  145.   
  146. ***************
  147. *** 8,16 ****
  148.   } Rapport;
  149.   int    rapSz = sizeof(Rapport);
  150.   
  151.   static void    insRap(), prRapAll(), prRap();
  152. ! static int        search(), compare();
  153.   
  154.   main()
  155.   {
  156.       int            id, code, search_date;
  157. --- 12,30 ----
  158.   } Rapport;
  159.   int    rapSz = sizeof(Rapport);
  160.   
  161. + #ifdef ANSI
  162. + static void    insRap(int id, int where, int flag, char *title, char *author,
  163. +                 int date);
  164. + static void    prRapAll(int id);
  165. + static void    prRap(int code, Rapport *rpprt);
  166. + static int    search(int *date, Rapport *rpprt);
  167. + static int    compare(Rapport *data1, Rapport *data2);
  168. + #else
  169.   static void    insRap(), prRapAll(), prRap();
  170. ! static int    search(), compare();
  171. ! #endif
  172.   
  173. + int
  174.   main()
  175.   {
  176.       int            id, code, search_date;
  177. ***************
  178. *** 82,89 ****
  179.   
  180.   static void
  181.   insRap(id, where, flag, title, author, date)
  182. ! int    id, where, flag, date;
  183. ! char    *title, *author;
  184.   {
  185.       int        code;
  186.       Rapport    rap;
  187. --- 96,103 ----
  188.   
  189.   static void
  190.   insRap(id, where, flag, title, author, date)
  191. ! int        id, where, flag, date;
  192. ! char        *title, *author;
  193.   {
  194.       int        code;
  195.       Rapport    rap;
  196. *** ../list.c    Mon May  3 11:08:59 1993
  197. --- list.c    Wed May 19 16:38:34 1993
  198. ***************
  199. *** 1,3 ****
  200. --- 1,6 ----
  201. + #pragma option -ml -v -vi- -w-ret -w-nci -w-inl -wamp -w-par -w-cpt -w-dup -w-pia -w-ill -w-sus -wstv -w-ext -w-ias -w-ibc -w-pre -w-nst -A -G -O2 -w-sus -w-aus -w-par -w-pro -w-rvl
  202. + /* line at the top added for Borland or other MSDOS C compilers */
  203.   /*
  204.   **    Anita Eijs    TNO-BOUW, BouwInformatica    May 1989
  205.   **
  206. ***************
  207. *** 41,72 ****
  208.   **    ***** Version 0.8, May 1993 *****
  209.   */
  210.   
  211. ! #ifdef MAC
  212. ! #define    MAC_OR_VAXC
  213.   #endif
  214. ! #ifdef VAXC
  215. ! #define    MAC_OR_VAXC
  216. ! #define    MSDOS_OR_VAXC
  217.   #endif
  218.   #ifdef MSDOS
  219. ! #define    MSDOS_OR_VAXC
  220.   #endif
  221.   
  222.   #ifdef MAC
  223.   #include    <unix.h>    /* open, creat, write, read, close */
  224.   #include    <stddef.h>    /* sizeof */
  225.   #endif
  226.   
  227. ! #ifdef MAC_OR_VAXC
  228.   #include    <stdlib.h>
  229. ! #else
  230. ! #include    <malloc.h>
  231.   #endif
  232.   
  233. - #ifdef MSDOS
  234. - #include    <io.h>    /* open, creat, write, read, close */
  235. - #endif
  236.   #include    <stdio.h>
  237.   #include    "list.h"
  238.   
  239. --- 44,84 ----
  240.   **    ***** Version 0.8, May 1993 *****
  241.   */
  242.   
  243. ! #ifdef __MSDOS__
  244. ! #define    MSDOS
  245. ! #define    ANSI
  246.   #endif
  247. ! #ifdef UNIX
  248. ! #include    <malloc.h>
  249.   #endif
  250.   #ifdef MSDOS
  251. ! #include    <malloc.h>
  252. ! #include    <io.h>        /* open, creat, write, read, close */
  253. !     /* added for Borland or other MSDOS C compilers */
  254. ! #include    <stdlib.h>
  255. ! #include    <fcntl.h>
  256. ! #include    <sys\types.h>
  257. ! #include    <sys\stat.h>
  258. ! #include    <string.h>
  259.   #endif
  260.   
  261. + #ifdef VAXC
  262. + #include    <stdlib.h>
  263. + #endif
  264.   #ifdef MAC
  265.   #include    <unix.h>    /* open, creat, write, read, close */
  266.   #include    <stddef.h>    /* sizeof */
  267. + #include    <stdlib.h>
  268.   #endif
  269.   
  270. ! #ifdef AMIGA
  271.   #include    <stdlib.h>
  272. ! #include    <fcntl.h>    /* open, creat, write, read, close */
  273.   #endif
  274.   
  275.   #include    <stdio.h>
  276.   #include    "list.h"
  277.   
  278. ***************
  279. *** 98,106 ****
  280.           while (i--) *to++ = *frm++; \
  281.       }
  282.   
  283. ! #define    BIN_WRITE    1    /* necessary for binary file access */
  284.   #define    BIN_READ    0
  285.   #define    PMODE        0666
  286.   
  287.   /* -------------------------------------------------------------------------- */
  288.   
  289. --- 110,125 ----
  290.           while (i--) *to++ = *frm++; \
  291.       }
  292.   
  293. !     /* necessary for binary file access */
  294. ! #ifdef MSDOS
  295. ! #define    BIN_WRITE    O_WRONLY|O_BINARY
  296. ! #define    BIN_READ    O_RDONLY|O_BINARY
  297. ! #define    PMODE        S_IREAD
  298. ! #else
  299. ! #define    BIN_WRITE    1
  300.   #define    BIN_READ    0
  301.   #define    PMODE        0666
  302. + #endif
  303.   
  304.   /* -------------------------------------------------------------------------- */
  305.   
  306. ***************
  307. *** 148,154 ****
  308.   static void    lError(char *str, int code, int int1, int int2, char *str1);
  309.   static int    setWhchNode(int id, int which, char *fname);
  310.   static int    setIndxNode(int id, int index, char *fname);
  311. ! static int    partition(NodePtr *array, int order, Func func, int lb, int ub,
  312.               int *pj);
  313.   static int    stack_empty(int id);
  314.   static int    intInSet(int intgr, int *set, int set_n);
  315. --- 167,173 ----
  316.   static void    lError(char *str, int code, int int1, int int2, char *str1);
  317.   static int    setWhchNode(int id, int which, char *fname);
  318.   static int    setIndxNode(int id, int index, char *fname);
  319. ! static void    partition(NodePtr *array, int order, Func func, int lb, int ub,
  320.               int *pj);
  321.   static int    stack_empty(int id);
  322.   static int    intInSet(int intgr, int *set, int set_n);
  323. ***************
  324. *** 159,165 ****
  325.   static void    lError();
  326.   static int    setWhchNode();
  327.   static int    setIndxNode();
  328. ! static int    partition();
  329.   static int    stack_empty();
  330.   static int    intInSet();
  331.   #endif
  332. --- 178,184 ----
  333.   static void    lError();
  334.   static int    setWhchNode();
  335.   static int    setIndxNode();
  336. ! static void    partition();
  337.   static int    stack_empty();
  338.   static int    intInSet();
  339.   #endif
  340. ***************
  341. *** 186,199 ****
  342.   ** Return on error:
  343.   **    lWRONG_SD, lWRONG_CC
  344.   */
  345. - #ifdef ANSI
  346.   int
  347. - lDef(int sd, int cc)
  348. - #else
  349. - int
  350.   lDef(sd, cc)
  351.   int    sd, cc;
  352. - #endif
  353.   {
  354.       ListPtr        list, new;
  355.       static int    set1[] = { lSINGLY, lDOUBLY },
  356. --- 205,213 ----
  357. ***************
  358. *** 245,258 ****
  359.   ** Return on error:
  360.   **    lUNKNOWN_ID
  361.   */
  362. - #ifdef ANSI
  363.   int
  364. - lInfo(int id, int *sd, int *cc, int *n)
  365. - #else
  366. - int
  367.   lInfo(id, sd, cc, n)
  368.   int    id, *sd, *cc, *n;
  369. - #endif
  370.   {
  371.       ListPtr    list;
  372.   
  373. --- 259,267 ----
  374. ***************
  375. *** 286,299 ****
  376.   ** Return on error:
  377.   **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_ORDER, lWRONG_THEORY
  378.   */
  379. - #ifdef ANSI
  380. - int lSort(int id, int order, int theory, Func func)
  381. - #else
  382.   int
  383.   lSort(id, order, theory, func)
  384.   int    id, order, theory;
  385.   Func    func;
  386. - #endif
  387.   {
  388.       int        node_n, i, s, f, k, where, j, cmp;
  389.       ListPtr        list;
  390. --- 295,304 ----
  391. ***************
  392. *** 320,331 ****
  393.           return(lWRONG_THEORY);
  394.       }
  395.   
  396.       node_n = list->n;
  397. !         /* allocate 1 extra so I can nave a null in it */
  398.       CALLOC(array, NodePtr, node_n+1);
  399.   
  400.       list->current = list->first;
  401. !     for (i=0; i<node_n && list->current != NULL ; i++) {
  402.           array[i] = list->current;
  403.           list->current = (list->current)->nxt;
  404.       }
  405. --- 325,340 ----
  406.           return(lWRONG_THEORY);
  407.       }
  408.   
  409. +         /* one node is already sorted */
  410. +     if (list->n == 1)
  411. +         return(lSUCCESS);
  412.       node_n = list->n;
  413. !         /* allocate 1 extra so I can have a null in it */
  414.       CALLOC(array, NodePtr, node_n+1);
  415.   
  416.       list->current = list->first;
  417. !     for (i=0; i < node_n && list->current != NULL; i++) {
  418.           array[i] = list->current;
  419.           list->current = (list->current)->nxt;
  420.       }
  421. ***************
  422. *** 377,386 ****
  423.                   s = -1;
  424.               else
  425.                   s = 1;
  426. !             cmp = (*func)(array[2]->data, array[1]->data);
  427. !             if (i > 2 && ((order == lASCENDING && cmp == l2LT1)
  428. !              || (order == lDESCENDING && cmp == l1LT2)))
  429. !                 s = 2;
  430.   
  431.               if (s >= 0)
  432.                   cmp = (*func)(temp->data, array[s]->data);
  433. --- 386,397 ----
  434.                   s = -1;
  435.               else
  436.                   s = 1;
  437. !             if (i > 2) {
  438. !                 cmp = (*func)(array[2]->data, array[1]->data);
  439. !                 if ((order == lASCENDING && cmp == l2LT1)
  440. !                  || (order == lDESCENDING && cmp == l1LT2))
  441. !                     s = 2;
  442. !             }
  443.   
  444.               if (s >= 0)
  445.                   cmp = (*func)(temp->data, array[s]->data);
  446. ***************
  447. *** 393,399 ****
  448.                   if (s+1 <= i-1) {
  449.                       cmp = (*func)(array[s]->data,
  450.                           array[s+1]->data);
  451. !                     if (cmp < 0)
  452.                           s = s+1;
  453.                   }
  454.                   if (s > i-1)
  455. --- 404,413 ----
  456.                   if (s+1 <= i-1) {
  457.                       cmp = (*func)(array[s]->data,
  458.                           array[s+1]->data);
  459. !                     if ((order == lASCENDING
  460. !                         && cmp == l1LT2) ||
  461. !                      (order == lDESCENDING
  462. !                         && cmp == l2LT1))
  463.                           s = s+1;
  464.                   }
  465.                   if (s > i-1)
  466. ***************
  467. *** 474,480 ****
  468.       case lSELECTION: {
  469.           int    indx;
  470.   
  471. !         for (i=node_n-1; i>0 ; i--) {
  472.               temp = array[0];
  473.               indx = 0;
  474.   
  475. --- 488,494 ----
  476.       case lSELECTION: {
  477.           int    indx;
  478.   
  479. !         for (i=node_n-1; i>0; i--) {
  480.               temp = array[0];
  481.               indx = 0;
  482.   
  483. ***************
  484. *** 557,571 ****
  485.   **    header.n    number of <info>-<data>-combinations (nodes)
  486.   **    info.size    size of <data>
  487.   */
  488. - #ifdef ANSI
  489.   int
  490. - lDump(int id, char *file)
  491. - #else
  492. - int
  493.   lDump(id, file)
  494.   int    id;
  495.   char    *file;
  496. - #endif
  497.   {
  498.   #ifndef MSDOS
  499.       int    open(), creat(), write(), close();
  500. --- 571,580 ----
  501. ***************
  502. *** 622,639 ****
  503.   ** Return on error:
  504.   **    lOPEN_ERROR
  505.   */
  506. - #ifdef ANSI
  507.   int
  508. - lUndump(char *file)
  509. - #else
  510. - int
  511.   lUndump(file)
  512.   char    *file;
  513. - #endif
  514.   {
  515.   #ifndef MSDOS
  516.       int    open(), read(), close();
  517.   #endif
  518.   
  519.       int    fdDump, i, id;
  520.       Info    info;
  521. --- 631,645 ----
  522.   ** Return on error:
  523.   **    lOPEN_ERROR
  524.   */
  525.   int
  526.   lUndump(file)
  527.   char    *file;
  528.   {
  529.   #ifndef MSDOS
  530. + #ifndef AMIGA
  531.       int    open(), read(), close();
  532.   #endif
  533. + #endif
  534.   
  535.       int    fdDump, i, id;
  536.       Info    info;
  537. ***************
  538. *** 674,687 ****
  539.   ** Return on error:
  540.   **    lUNKNOWN_ID
  541.   */
  542. - #ifdef ANSI
  543.   int
  544. - lDel(int id)
  545. - #else
  546. - int
  547.   lDel(id)
  548.   int    id;
  549. - #endif
  550.   {
  551.       ListPtr    list;
  552.   
  553. --- 680,688 ----
  554. ***************
  555. *** 710,722 ****
  556.   ** Return on error:
  557.   **    lNO_LIST
  558.   */
  559. - #ifdef ANSI
  560.   int
  561. - lDelAll(void)
  562. - #else
  563. - int
  564.   lDelAll()
  565. - #endif
  566.   {
  567.       ListPtr    list, nxt;
  568.   
  569. --- 711,718 ----
  570. ***************
  571. *** 760,774 ****
  572.   ** Return on error:
  573.   **    lUNKNOWN_ID, lWRONG_WHERE
  574.   */
  575. - #ifdef ANSI
  576.   int
  577. - lInsNode(int id, int where, Byte *data, int size, int flag)
  578. - #else
  579. - int
  580.   lInsNode(id, where, data, size, flag)
  581.   int    id, where, size, flag;
  582.   Byte    *data;
  583. - #endif
  584.   {
  585.       ListPtr        list;
  586.       NodePtr        node, new;
  587. --- 756,765 ----
  588. ***************
  589. *** 892,905 ****
  590.   ** Return on error:
  591.   **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lEOL, lNOT_DOUBLY
  592.   */
  593. - #ifdef ANSI
  594.   int
  595. - lInfoNode(int id, int which, int *size, int *flag)
  596. - #else
  597. - int
  598.   lInfoNode(id, which, size, flag)
  599.   int    id, which, *size, *flag;
  600. - #endif
  601.   {
  602.       ListPtr    list;
  603.       int    rtrn;
  604. --- 883,891 ----
  605. ***************
  606. *** 932,946 ****
  607.   ** Return on error:
  608.   **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lEOL, lNOT_DOUBLY, lSIZE_NE
  609.   */
  610. - #ifdef ANSI
  611.   int
  612. - lGetNode(int id, int which, Byte *data, int size)
  613. - #else
  614. - int
  615.   lGetNode(id, which, data, size)
  616.   int    id, which, size;
  617.   Byte    *data;
  618. - #endif
  619.   {
  620.       ListPtr    list;
  621.       int    rtrn;
  622. --- 918,927 ----
  623. ***************
  624. *** 959,965 ****
  625.   
  626.       BYTE_COPY((list->current)->data, data, size);
  627.   
  628. !     if (list->current == list->first)
  629.           return(lFIRST);
  630.       else if (list->current == list->last)
  631.           return(lLAST);
  632. --- 940,953 ----
  633.   
  634.       BYTE_COPY((list->current)->data, data, size);
  635.   
  636. !     if (list->n == 1) {
  637. !         if (which == lPREVIOUS || which == lLAST)
  638. !             return(lFIRST);
  639. !         else if (which == lNEXT || which == lFIRST)
  640. !             return(lLAST);
  641. !         else
  642. !             return(lLAST);    /* which == lCURRENT */
  643. !     } else if (list->current == list->first)
  644.           return(lFIRST);
  645.       else if (list->current == list->last)
  646.           return(lLAST);
  647. ***************
  648. *** 972,978 ****
  649.   **
  650.   ** Parameters:
  651.   **    In    int    id    identifier of linked list
  652. ! **    In    int    where    from where must be searched
  653.   **    In    Func    func    function for checking the data on conditions
  654.   **    In    Byte    *ptr    data for comparison in function
  655.   **    Out    Byte    *data    data of node
  656. --- 960,967 ----
  657.   **
  658.   ** Parameters:
  659.   **    In    int    id    identifier of linked list
  660. ! **    In    int    which    from which node must be searched and in which
  661. ! **                direction
  662.   **    In    Func    func    function for checking the data on conditions
  663.   **    In    Byte    *ptr    data for comparison in function
  664.   **    Out    Byte    *data    data of node
  665. ***************
  666. *** 981,998 ****
  667.   ** Return on success:
  668.   **    lFOUND, lFIRST, lLAST, lNOT_FOUND
  669.   ** Return on error:
  670. ! **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHERE, lUNKNOWN_FUNC, lNOT_DOUBLY
  671.   */
  672. - #ifdef ANSI
  673.   int
  674. ! lFndNode(int id, int where, Func func, Byte *ptr, Byte *data, int size)
  675. ! #else
  676. ! int
  677. ! lFndNode(id, where, func, ptr, data, size)
  678. ! int    id, where, size;
  679.   Func    func;
  680.   Byte    *ptr, *data;
  681. - #endif
  682.   {
  683.       NodePtr        node;
  684.       ListPtr        list;
  685. --- 970,982 ----
  686.   ** Return on success:
  687.   **    lFOUND, lFIRST, lLAST, lNOT_FOUND
  688.   ** Return on error:
  689. ! **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lUNKNOWN_FUNC, lNOT_DOUBLY
  690.   */
  691.   int
  692. ! lFndNode(id, which, func, ptr, data, size)
  693. ! int    id, which, size;
  694.   Func    func;
  695.   Byte    *ptr, *data;
  696.   {
  697.       NodePtr        node;
  698.       ListPtr        list;
  699. ***************
  700. *** 1008,1016 ****
  701.           lError("lFndNode", lEMPTY_LIST, id, 0, NULL);
  702.           return(lEMPTY_LIST);
  703.       }
  704. !     if (intInSet(where, set, 4) != 0) {
  705. !         lError("lFndNode", lWRONG_WHERE, where, 0, NULL);
  706. !         return(lWRONG_WHERE);
  707.       }
  708.       if (func == NULL) {
  709.           lError("lFndNode", lUNKNOWN_FUNC, (int) func, 0, NULL);
  710. --- 992,1000 ----
  711.           lError("lFndNode", lEMPTY_LIST, id, 0, NULL);
  712.           return(lEMPTY_LIST);
  713.       }
  714. !     if (intInSet(which, set, 4) != 0) {
  715. !         lError("lFndNode", lWRONG_WHICH, which, 0, NULL);
  716. !         return(lWRONG_WHICH);
  717.       }
  718.       if (func == NULL) {
  719.           lError("lFndNode", lUNKNOWN_FUNC, (int) func, 0, NULL);
  720. ***************
  721. *** 1017,1024 ****
  722.           return(lUNKNOWN_FUNC);
  723.       }
  724.   
  725. !         /* set node for where searching must start */
  726. !     switch (where) {
  727.       case lFIRST:    node = list->first;    break;
  728.       case lNEXT:
  729.       case lPREVIOUS:    node = list->current;    break;
  730. --- 1001,1008 ----
  731.           return(lUNKNOWN_FUNC);
  732.       }
  733.   
  734. !         /* set node where searching must start */
  735. !     switch (which) {
  736.       case lFIRST:    node = list->first;    break;
  737.       case lNEXT:
  738.       case lPREVIOUS:    node = list->current;    break;
  739. ***************
  740. *** 1026,1037 ****
  741.       }
  742.   
  743.           /* expected data and node must have same size */
  744. !     if ((where == lFIRST || where == lLAST) && node->size == size) {
  745.           BYTE_COPY(node->data, data, size);
  746.           cmp = (*func)(ptr, data);
  747.       }
  748.   
  749. !     switch (where) {
  750.       case lFIRST:    /* search forward */
  751.       case lNEXT:
  752.           while (cmp != lFOUND && node->nxt != NULL
  753. --- 1010,1021 ----
  754.       }
  755.   
  756.           /* expected data and node must have same size */
  757. !     if ((which == lFIRST || which == lLAST) && node->size == size) {
  758.           BYTE_COPY(node->data, data, size);
  759.           cmp = (*func)(ptr, data);
  760.       }
  761.   
  762. !     switch (which) {
  763.       case lFIRST:    /* search forward */
  764.       case lNEXT:
  765.           while (cmp != lFOUND && node->nxt != NULL
  766. ***************
  767. *** 1080,1085 ****
  768. --- 1064,1071 ----
  769.   **
  770.   ** Parameters:
  771.   **    In    int    id    identifier of linked list
  772. + **    In    int    which    from which node must be searched and in which
  773. + **                direction
  774.   **    In    int    flag    flag of node which must be retrieved
  775.   **    Out    Byte    *data    data of node
  776.   **    In    int    size    size of data
  777. ***************
  778. *** 1087,1103 ****
  779.   ** Return on success:
  780.   **    lFOUND, lFIRST, lLAST, lNOT_FOUND
  781.   ** Return on error:
  782. ! **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHERE, lSIZE_NE
  783.   */
  784. - #ifdef ANSI
  785.   int
  786. ! lFndFlagNode(int id, int where, int flag, Byte *data, int size)
  787. ! #else
  788. ! int
  789. ! lFndFlagNode(id, where, flag, data, size)
  790. ! int    id, where, flag, size;
  791.   Byte    *data;
  792. - #endif
  793.   {
  794.       NodePtr        node;
  795.       ListPtr        list;
  796. --- 1073,1084 ----
  797.   ** Return on success:
  798.   **    lFOUND, lFIRST, lLAST, lNOT_FOUND
  799.   ** Return on error:
  800. ! **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lSIZE_NE
  801.   */
  802.   int
  803. ! lFndFlagNode(id, which, flag, data, size)
  804. ! int    id, which, flag, size;
  805.   Byte    *data;
  806.   {
  807.       NodePtr        node;
  808.       ListPtr        list;
  809. ***************
  810. *** 1112,1124 ****
  811.           lError("lFndFlagNode", lEMPTY_LIST, id, 0, NULL);
  812.           return(lEMPTY_LIST);
  813.       }
  814. !     if (intInSet(where, set, 4) != 0) {
  815. !         lError("lFndFlagNode", lWRONG_WHERE, where, 0, NULL);
  816. !         return(lWRONG_WHERE);
  817.       }
  818.   
  819. !         /* set node for where searching must start */
  820. !     switch (where) {
  821.       case lFIRST:
  822.           node = list->first;
  823.           break;
  824. --- 1093,1105 ----
  825.           lError("lFndFlagNode", lEMPTY_LIST, id, 0, NULL);
  826.           return(lEMPTY_LIST);
  827.       }
  828. !     if (intInSet(which, set, 4) != 0) {
  829. !         lError("lFndFlagNode", lWRONG_WHICH, which, 0, NULL);
  830. !         return(lWRONG_WHICH);
  831.       }
  832.   
  833. !         /* set node where searching must start */
  834. !     switch (which) {
  835.       case lFIRST:
  836.           node = list->first;
  837.           break;
  838. ***************
  839. *** 1138,1144 ****
  840.       }
  841.   
  842.           /* search till begin/end of list */
  843. !     switch (where) {
  844.       case lFIRST:    /* search forward */
  845.       case lNEXT:
  846.           while (node->flag != flag && node != list->last)
  847. --- 1119,1125 ----
  848.       }
  849.   
  850.           /* search till begin/end of list */
  851. !     switch (which) {
  852.       case lFIRST:    /* search forward */
  853.       case lNEXT:
  854.           while (node->flag != flag && node != list->last)
  855. ***************
  856. *** 1172,1178 ****
  857.   
  858.       BYTE_COPY((list->current)->data, data, size);
  859.   
  860. !     if (list->current == list->first)
  861.           return(lFIRST);
  862.       else if (list->current == list->last)
  863.           return(lLAST);
  864. --- 1153,1166 ----
  865.   
  866.       BYTE_COPY((list->current)->data, data, size);
  867.   
  868. !     if (list->n == 1) {
  869. !         if (which == lPREVIOUS || which == lLAST)
  870. !             return(lFIRST);
  871. !         else if (which == lNEXT || which == lFIRST)
  872. !             return(lLAST);
  873. !         else
  874. !             return(lLAST);    /* which == lCURRENT */
  875. !     } else if (list->current == list->first)
  876.           return(lFIRST);
  877.       else if (list->current == list->last)
  878.           return(lLAST);
  879. ***************
  880. *** 1181,1187 ****
  881.   }
  882.   
  883.   /*******************************************************************************
  884. ! ** Update curent node.
  885.   **
  886.   ** Parameters:
  887.   **    In    int    id    identifier of linked list
  888. --- 1169,1175 ----
  889.   }
  890.   
  891.   /*******************************************************************************
  892. ! ** Update current node.
  893.   **
  894.   ** Parameters:
  895.   **    In    int    id    identifier of linked list
  896. ***************
  897. *** 1194,1208 ****
  898.   ** Return on error:
  899.   **    lUNKNOWN_ID, lEMPTY_LIST
  900.   */
  901. - #ifdef ANSI
  902.   int
  903. - lUpdNode(int id, Byte *data, int size, int flag)
  904. - #else
  905. - int
  906.   lUpdNode(id, data, size, flag)
  907.   int    id, size, flag;
  908.   Byte    *data;
  909. - #endif
  910.   {
  911.       ListPtr    list;
  912.   
  913. --- 1182,1191 ----
  914. ***************
  915. *** 1242,1255 ****
  916.   ** Return on error:
  917.   **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH
  918.   */
  919. - #ifdef ANSI
  920.   int
  921. - lDelNode(int id, int which)
  922. - #else
  923. - int
  924.   lDelNode(id, which)
  925.   int    id, which;
  926. - #endif
  927.   {
  928.       NodePtr        node, prv, nxt;
  929.       ListPtr        list;
  930. --- 1225,1233 ----
  931. ***************
  932. *** 1355,1368 ****
  933.   ** Return on error:
  934.   **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_INDEX
  935.   */
  936. - #ifdef ANSI
  937.   int
  938. - lInfoIndxNode(int id, int index, int *size, int *flag)
  939. - #else
  940. - int
  941.   lInfoIndxNode(id, index, size, flag)
  942.   int    id, index, *size, *flag;
  943. - #endif
  944.   {
  945.       ListPtr    list;
  946.       int    rtrn;
  947. --- 1333,1341 ----
  948. ***************
  949. *** 1394,1408 ****
  950.   ** Return on error:
  951.   **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_INDEX, lSIZE_NE
  952.   */
  953. - #ifdef ANSI
  954.   int
  955. - lGetIndxNode(int id, int index, Byte *data, int size)
  956. - #else
  957. - int
  958.   lGetIndxNode(id, index, data, size)
  959.   int    id, index, size;
  960.   Byte    *data;
  961. - #endif
  962.   {
  963.       ListPtr    list;
  964.       int    rtrn;
  965. --- 1367,1376 ----
  966. ***************
  967. *** 1422,1428 ****
  968.   
  969.       BYTE_COPY((list->current)->data, data, size);
  970.   
  971. !     if (list->current == list->first)
  972.           return(lFIRST);
  973.       else if (list->current == list->last)
  974.           return(lLAST);
  975. --- 1390,1398 ----
  976.   
  977.       BYTE_COPY((list->current)->data, data, size);
  978.   
  979. !     if (list->n == 1)
  980. !         return(lLAST);
  981. !     else if (list->current == list->first)
  982.           return(lFIRST);
  983.       else if (list->current == list->last)
  984.           return(lLAST);
  985. ***************
  986. *** 1445,1459 ****
  987.   ** Return on error:
  988.   **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_INDEX
  989.   */
  990. - #ifdef ANSI
  991.   int
  992. - lUpdIndxNode(int id, int index, Byte *data, int size, int flag)
  993. - #else
  994. - int
  995.   lUpdIndxNode(id, index, data, size, flag)
  996.   int    id, index, size, flag;
  997.   Byte    *data;
  998. - #endif
  999.   {
  1000.       ListPtr    list;
  1001.       int    rtrn;
  1002. --- 1415,1424 ----
  1003. ***************
  1004. *** 1489,1502 ****
  1005.   ** Return on error:
  1006.   **    lUNKNOWN_ID, lEMPTY_LIST, lWRONG_INDEX
  1007.   */
  1008. - #ifdef ANSI
  1009.   int
  1010. - lDelIndxNode(int id, int index)
  1011. - #else
  1012. - int
  1013.   lDelIndxNode(id, index)
  1014.   int    id, index;
  1015. - #endif
  1016.   {
  1017.       int    rtrn;
  1018.   
  1019. --- 1454,1462 ----
  1020. ***************
  1021. *** 1510,1523 ****
  1022.   /* ---------- static local functions ---------------------------------------- */
  1023.   
  1024.   /* get address of list data */
  1025. - #ifdef ANSI
  1026.   static ListPtr
  1027. - getAddress(int id)
  1028. - #else
  1029. - static ListPtr
  1030.   getAddress(id)
  1031.   int    id;
  1032. - #endif
  1033.   {
  1034.       ListPtr    list;
  1035.   
  1036. --- 1470,1478 ----
  1037. ***************
  1038. *** 1535,1549 ****
  1039.   }
  1040.   
  1041.   /* delete nodes of a linked list */
  1042. - #ifdef ANSI
  1043.   static void
  1044. - delNodes(NodePtr node, int n)
  1045. - #else
  1046. - static void
  1047.   delNodes(node, n)
  1048.   NodePtr    node;
  1049.   int    n;
  1050. - #endif
  1051.   {
  1052.       NodePtr    nxt;
  1053.       int    i;
  1054. --- 1490,1499 ----
  1055. ***************
  1056. *** 1557,1570 ****
  1057.   }
  1058.   
  1059.   /* delete info about linked list */
  1060. - #ifdef ANSI
  1061.   static void
  1062. - delListInfo(ListPtr list)
  1063. - #else
  1064. - static void
  1065.   delListInfo(list)
  1066.   ListPtr    list;
  1067. - #endif
  1068.   {
  1069.       ListPtr    nxt;
  1070.   
  1071. --- 1507,1515 ----
  1072. ***************
  1073. *** 1576,1592 ****
  1074.   }
  1075.   
  1076.   /* print error message in lERROR_FILE */
  1077. - #ifdef ANSI
  1078.   static void
  1079. - lError(char *str, int code, int int1, int int2, char *str1)
  1080. - #else
  1081. - static void
  1082.   lError(str, code, int1, int2, str1)
  1083.   char    *str, *str1;
  1084.   int    code, int1, int2;
  1085. - #endif
  1086.   {
  1087. - #ifndef MSDOS
  1088.       char    mess[60];
  1089.       FILE    *fpError, *fopen();
  1090.   
  1091. --- 1521,1531 ----
  1092. ***************
  1093. *** 1660,1680 ****
  1094.           fprintf(stderr, "Can't open error-file '%s'\n", lERROR_FILE);
  1095.           fprintf(stderr, "Error, '%s': %s\n", str, mess);
  1096.       } else {
  1097. !         fprintf(fpError, "Error, '%s': %s\n", str, mess);
  1098.           fclose(fpError);
  1099.       }
  1100. - #endif
  1101.   }
  1102.   
  1103. - #ifdef ANSI
  1104.   static int
  1105. - setWhchNode(int id, int which, char *fname)
  1106. - #else
  1107. - static int
  1108.   setWhchNode(id, which, fname)
  1109.   int    id, which;
  1110.   char    *fname;
  1111. - #endif
  1112.   {
  1113.       ListPtr        list;
  1114.       static int    set[] = { lFIRST, lNEXT, lCURRENT, lPREVIOUS, lLAST };
  1115. --- 1599,1613 ----
  1116.           fprintf(stderr, "Can't open error-file '%s'\n", lERROR_FILE);
  1117.           fprintf(stderr, "Error, '%s': %s\n", str, mess);
  1118.       } else {
  1119. !         fprintf(fpError, "Error in '%s': %s\n", str, mess);
  1120.           fclose(fpError);
  1121.       }
  1122.   }
  1123.   
  1124.   static int
  1125.   setWhchNode(id, which, fname)
  1126.   int    id, which;
  1127.   char    *fname;
  1128.   {
  1129.       ListPtr        list;
  1130.       static int    set[] = { lFIRST, lNEXT, lCURRENT, lPREVIOUS, lLAST };
  1131. ***************
  1132. *** 1726,1740 ****
  1133.       return(lSUCCESS);
  1134.   }
  1135.   
  1136. - #ifdef ANSI
  1137.   static int
  1138. - setIndxNode(int id, int index, char *fname)
  1139. - #else
  1140. - static int
  1141.   setIndxNode(id, index, fname)
  1142.   int    id, index;
  1143.   char    *fname;
  1144. - #endif
  1145.   {
  1146.       ListPtr    list;
  1147.       int    i;
  1148. --- 1659,1668 ----
  1149. ***************
  1150. *** 1767,1782 ****
  1151.   }
  1152.   
  1153.   /* local function for QUICK sort */
  1154. ! #ifdef ANSI
  1155. ! static int
  1156. ! partition(NodePtr *array, int order, Func func, int lb, int ub, int *pj)
  1157. ! #else
  1158. ! static int
  1159.   partition(array, order, func, lb, ub, pj)
  1160.   NodePtr    *array;
  1161.   int    order, lb, ub, *pj;
  1162.   Func    func;
  1163. - #endif
  1164.   {
  1165.       int    down, up, cmp;
  1166.       NodePtr    temp, a;
  1167. --- 1695,1705 ----
  1168.   }
  1169.   
  1170.   /* local function for QUICK sort */
  1171. ! static void
  1172.   partition(array, order, func, lb, ub, pj)
  1173.   NodePtr    *array;
  1174.   int    order, lb, ub, *pj;
  1175.   Func    func;
  1176.   {
  1177.       int    down, up, cmp;
  1178.       NodePtr    temp, a;
  1179. ***************
  1180. *** 1812,1825 ****
  1181.   }
  1182.   
  1183.   /* local function for QUICK sort */
  1184. - #ifdef ANSI
  1185.   static int
  1186. - stack_empty(int id)
  1187. - #else
  1188. - static int
  1189.   stack_empty(id)
  1190.   int    id;
  1191. - #endif
  1192.   {
  1193.       int    sd, cc, n;
  1194.   
  1195. --- 1735,1743 ----
  1196. *** ../list.h    Tue Apr 20 11:06:14 1993
  1197. --- list.h    Wed May 19 10:08:47 1993
  1198. ***************
  1199. *** 50,59 ****
  1200.   
  1201.   #define    lFOUND        0    /* node found */
  1202.   
  1203. ! #ifdef MSDOS_OR_VAXC
  1204.   #define    lERROR_FILE    "linklist.err"
  1205.   #else
  1206.   #define    lERROR_FILE    "=listError="
  1207.   #endif
  1208.   
  1209.   #ifdef ANSI
  1210. --- 50,63 ----
  1211.   
  1212.   #define    lFOUND        0    /* node found */
  1213.   
  1214. ! #ifdef MSDOS
  1215.   #define    lERROR_FILE    "linklist.err"
  1216.   #else
  1217. + # ifdef VAXC
  1218. + #define    lERROR_FILE    "linklist.err"
  1219. + # else
  1220.   #define    lERROR_FILE    "=listError="
  1221. + # endif
  1222.   #endif
  1223.   
  1224.   #ifdef ANSI
  1225. *** ../sorted.c    Fri Feb 26 11:25:09 1993
  1226. --- sorted.c    Wed May 19 14:09:36 1993
  1227. ***************
  1228. *** 2,10 ****
  1229.   #include    <string.h>
  1230.   #include    "list.h"
  1231.   
  1232. - static void    addPersonSorted(), addPerson();
  1233. - static int    fndNxtPerson(), sortPerson(), compare();
  1234.   typedef struct person {
  1235.       char    lastname[15];
  1236.       char    firstname[15];
  1237. --- 2,7 ----
  1238. ***************
  1239. *** 11,16 ****
  1240. --- 8,25 ----
  1241.   } Person, *PersonPtr;
  1242.   int    personSz = sizeof(Person);
  1243.   
  1244. + #ifdef ANSI
  1245. + static void    addPerson(int id, char *first, char *last);
  1246. + static void    addPersonSorted(int id, char *first, char *last);
  1247. + static int    compare(PersonPtr p1, PersonPtr p2, int order);
  1248. + static int    fndNxtPerson(char *last, PersonPtr data);
  1249. + static int    sortPerson(int id);
  1250. + #else
  1251. + static void    addPerson(), addPersonSorted();
  1252. + static int    compare(), fndNxtPerson(), sortPerson();
  1253. + #endif
  1254. + int
  1255.   main()
  1256.   {
  1257.       Person    person;
  1258. *** ../sorttest.c    Mon May  3 11:45:21 1993
  1259. --- sorttest.c    Wed May 19 14:37:07 1993
  1260. ***************
  1261. *** 1,9 ****
  1262.   /* Sort torture test */
  1263.   
  1264.   #include    <stdio.h>
  1265.   #include    <string.h>
  1266.   #include    "list.h"
  1267. - #include    "time.h"
  1268.   
  1269.   typedef struct catalog {
  1270.       char        number[35];
  1271. --- 1,21 ----
  1272.   /* Sort torture test */
  1273.   
  1274. + #ifdef UNIX
  1275. + #include    <malloc.h>
  1276. + #endif
  1277. + #ifdef    AMIGA
  1278. + #include    <stdlib.h>
  1279. + #endif
  1280. + #ifdef MSDOS
  1281. + #include    <malloc.h>
  1282. + #endif
  1283.   #include    <stdio.h>
  1284.   #include    <string.h>
  1285. + #include    <time.h>
  1286.   #include    "list.h"
  1287.   
  1288.   typedef struct catalog {
  1289.       char        number[35];
  1290. ***************
  1291. *** 12,32 ****
  1292.       int        date;
  1293.   } catalog;
  1294.   
  1295.   static int    compare_author();
  1296.   static int    compare_title();
  1297.   static void    load_it();
  1298.   static void    print_some();
  1299.   static time_t    what_time();
  1300.   static void    prRap();
  1301.   
  1302. - #ifdef ANSI
  1303.   static int
  1304. - compare_author(catalog *a, catalog *b)
  1305. - #else
  1306. - static int
  1307.   compare_author(a, b)
  1308.   catalog *a, *b;
  1309. - #endif
  1310.   {
  1311.       int    k;
  1312.   
  1313. --- 24,50 ----
  1314.       int        date;
  1315.   } catalog;
  1316.   
  1317. + #ifdef ANSI
  1318. + static int    compare_author(catalog *a, catalog *b);
  1319. + static int    compare_title(catalog *a, catalog *b, int order);
  1320. + static void    load_it(int id, int num);
  1321. + static void    print_some(int id, int num);
  1322. + static time_t    what_time(void);
  1323. + static void    diff_time(time_t a, time_t b);
  1324. + static void    prRap(int code, catalog *rpprt);
  1325. + #else
  1326.   static int    compare_author();
  1327.   static int    compare_title();
  1328.   static void    load_it();
  1329.   static void    print_some();
  1330.   static time_t    what_time();
  1331. + static void    diff_time();
  1332.   static void    prRap();
  1333. + #endif
  1334.   
  1335.   static int
  1336.   compare_author(a, b)
  1337.   catalog *a, *b;
  1338.   {
  1339.       int    k;
  1340.   
  1341. ***************
  1342. *** 40,54 ****
  1343.           return(l1LT2);
  1344.   }
  1345.   
  1346. - #ifdef ANSI
  1347.   static int
  1348. - compare_title(catalog *a, catalog *b, int order)
  1349. - #else
  1350. - static int
  1351.   compare_title(a, b, order)
  1352.   catalog *a, *b;
  1353.   int order;
  1354. - #endif
  1355.   {
  1356.       int    k;
  1357.   
  1358. --- 58,67 ----
  1359. ***************
  1360. *** 62,76 ****
  1361.           return(l1LT2);
  1362.   }
  1363.   
  1364. - #ifdef ANSI
  1365.   static void
  1366. - load_it(int id, int num)
  1367. - #else
  1368. - static void
  1369.   load_it(id, num)
  1370.   int id;
  1371.   int num;
  1372. - #endif
  1373.   {
  1374.       int    loop, size = sizeof(catalog), code;
  1375.       char    c1, c2, c3, c4, c5, c6, c7, c8;
  1376. --- 75,84 ----
  1377. ***************
  1378. *** 99,113 ****
  1379.       /* printf("Linked List created\n"); */
  1380.   }
  1381.   
  1382. - #ifdef ANSI
  1383.   static void
  1384. - print_some(int id, int num)
  1385. - #else
  1386. - static void
  1387.   print_some(id, num)
  1388.   int id;
  1389.   int num;
  1390. - #endif
  1391.   {
  1392.       int    size = sizeof(catalog), loop;
  1393.       int    code;
  1394. --- 107,116 ----
  1395. ***************
  1396. *** 122,142 ****
  1397.       }
  1398.   }
  1399.   
  1400. ! #ifdef ANSI
  1401. ! static time_t what_time(void)
  1402. ! #else
  1403. ! static time_t what_time()
  1404. ! #endif
  1405.   {
  1406.       return((time_t)time(NULL));
  1407.   }
  1408.   
  1409. ! #ifdef ANSI
  1410. ! static void diff_time(time_t a, time_t b)
  1411. ! #else
  1412. ! static void diff_time(a, b)
  1413.   time_t a, b;
  1414. - #endif
  1415.   {
  1416.       struct tm    *tt;
  1417.       char        buf1[101], buf2[101];
  1418. --- 125,139 ----
  1419.       }
  1420.   }
  1421.   
  1422. ! static time_t
  1423. ! what_time()
  1424.   {
  1425.       return((time_t)time(NULL));
  1426.   }
  1427.   
  1428. ! static void
  1429. ! diff_time(a, b)
  1430.   time_t a, b;
  1431.   {
  1432.       struct tm    *tt;
  1433.       char        buf1[101], buf2[101];
  1434. ***************
  1435. *** 160,165 ****
  1436. --- 157,163 ----
  1437.       (sec[1] - sec[0] > 0)?(sec[1] - sec[0]) : (sec[0] - sec[1]));
  1438.   }
  1439.   
  1440. + int
  1441.   main()
  1442.   {
  1443.       int    size = sizeof(catalog);
  1444. ***************
  1445. *** 175,181 ****
  1446.       printf("Untouched list\n");
  1447.       print_some(id, 10);
  1448.   
  1449. !     printf("-- lQuickSort --\nlQuickSort DESCENDING by TITLE : ");
  1450.       start = what_time();
  1451.       code = lSort(id, lDESCENDING, lQUICK, compare_title);
  1452.       finish = what_time();
  1453. --- 173,179 ----
  1454.       printf("Untouched list\n");
  1455.       print_some(id, 10);
  1456.   
  1457. !     printf("lQuickSort DESCENDING by TITLE : ");
  1458.       start = what_time();
  1459.       code = lSort(id, lDESCENDING, lQUICK, compare_title);
  1460.       finish = what_time();
  1461. ***************
  1462. *** 213,219 ****
  1463.       printf("Untouched list\n");
  1464.       print_some(id, 10);
  1465.   
  1466. !     printf(" -- lHeapSort -- \nlHeapSort DESCENDING by TITLE : ");
  1467.       start = what_time();
  1468.       code = lSort(id, lDESCENDING, lHEAP, compare_title);
  1469.       finish = what_time();
  1470. --- 211,217 ----
  1471.       printf("Untouched list\n");
  1472.       print_some(id, 10);
  1473.   
  1474. !     printf("lHeapSort DESCENDING by TITLE : ");
  1475.       start = what_time();
  1476.       code = lSort(id, lDESCENDING, lHEAP, compare_title);
  1477.       finish = what_time();
  1478. ***************
  1479. *** 332,343 ****
  1480.   
  1481.   static void
  1482.   prRap(code, rpprt)
  1483. ! int            code;
  1484. ! catalog        *rpprt;
  1485.   {
  1486.       if (code >= 0)
  1487. !         printf("catalog :'%s' '%s' '%s' '%d'\n", rpprt->number, rpprt->title,
  1488. !             rpprt->author, rpprt->date);
  1489.       else
  1490.           printf("Return code = %d\n", code);
  1491.   }
  1492. --- 330,341 ----
  1493.   
  1494.   static void
  1495.   prRap(code, rpprt)
  1496. ! int    code;
  1497. ! catalog    *rpprt;
  1498.   {
  1499.       if (code >= 0)
  1500. !         printf("catalog :'%s'\t'%s'\t'%s'\t'%d'\n", rpprt->number,
  1501. !             rpprt->title, rpprt->author, rpprt->date);
  1502.       else
  1503.           printf("Return code = %d\n", code);
  1504.   }
  1505. *** ../Doc/Intro.3    Fri Feb 26 10:56:12 1993
  1506. --- Doc/Intro.3    Thu May 27 12:01:52 1993
  1507. ***************
  1508. *** 1,4 ****
  1509. - '.so tmac.clman
  1510.   .TH "Intro"
  1511.   .IX Intro
  1512.   .SH NAME
  1513. --- 1,3 ----
  1514. ***************
  1515. *** 78,83 ****
  1516. --- 77,86 ----
  1517.   .SH EXAMPLE
  1518.   .if t .ta 0.3i 0.6i 0.9i 1.2i 2.2i 3.2i 4.2i 4.5i 4.8i
  1519.   .nf
  1520. + #ifdef    AMIGA
  1521. + #include        <string.h>
  1522. + #endif
  1523.   #include        <stdio.h>
  1524.   #include        "list.h"
  1525.   
  1526. ***************
  1527. *** 88,96 ****
  1528.   } Rapport;
  1529.   int    rapSz = sizeof(Rapport);
  1530.   
  1531.   static void    insRap(), prRapAll(), prRap();
  1532. ! static int        search(), compare();
  1533.   
  1534.   main()
  1535.   {
  1536.       int            id, code, search_date;
  1537. --- 91,109 ----
  1538.   } Rapport;
  1539.   int    rapSz = sizeof(Rapport);
  1540.   
  1541. + #ifdef ANSI
  1542. + static void    insRap(int id, int where, int flag, char *title, char *author,
  1543. +                 int date);
  1544. + static void    prRapAll(int id);
  1545. + static void    prRap(int code, Rapport *rpprt);
  1546. + static int    search(int *date, Rapport *rpprt);
  1547. + static int    compare(Rapport *data1, Rapport *data2);
  1548. + #else
  1549.   static void    insRap(), prRapAll(), prRap();
  1550. ! static int    search(), compare();
  1551. ! #endif
  1552.   
  1553. + int
  1554.   main()
  1555.   {
  1556.       int            id, code, search_date;
  1557. ***************
  1558. *** 102,111 ****
  1559.       insRap(id, lFIRST, 2, "Book 2", "More People", 890130);
  1560.       insRap(id, lLAST, 1, "Book 3", "Lots of People", 890131);
  1561.   
  1562. !     fprintf(stdout, "lGetNode\n");
  1563.       prRapAll(id);
  1564.   
  1565. !     fprintf(stdout, "lGetIndxNode\n");
  1566.       code = lGetIndxNode(id, 4, &rap, rapSz);
  1567.       prRap(code, &rap);
  1568.       code = lGetIndxNode(id, 2, &rap, rapSz);
  1569. --- 115,124 ----
  1570.       insRap(id, lFIRST, 2, "Book 2", "More People", 890130);
  1571.       insRap(id, lLAST, 1, "Book 3", "Lots of People", 890131);
  1572.   
  1573. !     fprintf(stdout, "lGetNode\\n");
  1574.       prRapAll(id);
  1575.   
  1576. !     fprintf(stdout, "lGetIndxNode\\n");
  1577.       code = lGetIndxNode(id, 4, &rap, rapSz);
  1578.       prRap(code, &rap);
  1579.       code = lGetIndxNode(id, 2, &rap, rapSz);
  1580. ***************
  1581. *** 115,121 ****
  1582.       code = lGetIndxNode(id, 3, &rap, rapSz);
  1583.       prRap(code, &rap);
  1584.   
  1585. !     fprintf(stdout, "lFndNode\n");
  1586.       search_date = 890129;
  1587.       code = lFndNode(id, lFIRST, search, &search_date, &rap, rapSz);
  1588.       prRap(code, &rap);
  1589. --- 128,134 ----
  1590.       code = lGetIndxNode(id, 3, &rap, rapSz);
  1591.       prRap(code, &rap);
  1592.   
  1593. !     fprintf(stdout, "lFndNode\\n");
  1594.       search_date = 890129;
  1595.       code = lFndNode(id, lFIRST, search, &search_date, &rap, rapSz);
  1596.       prRap(code, &rap);
  1597. ***************
  1598. *** 125,142 ****
  1599.       prRap(code, &rap);
  1600.   
  1601.       code = lDump(id, "dump");
  1602. !     fprintf(stdout, "lDump : %d\n", code);
  1603.   
  1604.       lDel(id);
  1605.   
  1606.       id = lUndump("dump");
  1607. !     fprintf(stdout, "lUndump : %d\n", id);
  1608.   
  1609.       insRap(id, lFIRST, 4, "Book 4", "The Author", 891127);
  1610.   
  1611.       prRapAll(id);
  1612.   
  1613. !     fprintf(stdout, "lFndFlagNode\n");
  1614.       code = lFndFlagNode(id, lFIRST, 1, &rap, rapSz);
  1615.       prRap(code, &rap);
  1616.       code = lFndFlagNode(id, lNEXT, 1, &rap, rapSz);
  1617. --- 138,155 ----
  1618.       prRap(code, &rap);
  1619.   
  1620.       code = lDump(id, "dump");
  1621. !     fprintf(stdout, "lDump : %d\\n", code);
  1622.   
  1623.       lDel(id);
  1624.   
  1625.       id = lUndump("dump");
  1626. !     fprintf(stdout, "lUndump : %d\\n", id);
  1627.   
  1628.       insRap(id, lFIRST, 4, "Book 4", "The Author", 891127);
  1629.   
  1630.       prRapAll(id);
  1631.   
  1632. !     fprintf(stdout, "lFndFlagNode\\n");
  1633.       code = lFndFlagNode(id, lFIRST, 1, &rap, rapSz);
  1634.       prRap(code, &rap);
  1635.       code = lFndFlagNode(id, lNEXT, 1, &rap, rapSz);
  1636. ***************
  1637. *** 146,159 ****
  1638.       code = lFndFlagNode(id, lFIRST, 7, &rap, rapSz);
  1639.       prRap(code, &rap);
  1640.       
  1641. !     fprintf(stdout, "Untouched list\n");
  1642.       prRapAll(id);
  1643.   
  1644. !     fprintf(stdout, "lSort\n");
  1645.       lSort(id, lDESCENDING, lBUBBLE, compare);
  1646.       prRapAll(id);
  1647.   
  1648. !     fprintf(stdout, "lSort\n");
  1649.       lSort(id, lASCENDING, lHEAP, compare);
  1650.       prRapAll(id);
  1651.   
  1652. --- 159,172 ----
  1653.       code = lFndFlagNode(id, lFIRST, 7, &rap, rapSz);
  1654.       prRap(code, &rap);
  1655.       
  1656. !     fprintf(stdout, "Untouched list\\n");
  1657.       prRapAll(id);
  1658.   
  1659. !     fprintf(stdout, "lSort\\n");
  1660.       lSort(id, lDESCENDING, lBUBBLE, compare);
  1661.       prRapAll(id);
  1662.   
  1663. !     fprintf(stdout, "lSort\\n");
  1664.       lSort(id, lASCENDING, lHEAP, compare);
  1665.       prRapAll(id);
  1666.   
  1667. ***************
  1668. *** 162,169 ****
  1669.   
  1670.   static void
  1671.   insRap(id, where, flag, title, author, date)
  1672. ! int    id, where, flag, date;
  1673. ! char    *title, *author;
  1674.   {
  1675.       int        code;
  1676.       Rapport    rap;
  1677. --- 175,182 ----
  1678.   
  1679.   static void
  1680.   insRap(id, where, flag, title, author, date)
  1681. ! int        id, where, flag, date;
  1682. ! char        *title, *author;
  1683.   {
  1684.       int        code;
  1685.       Rapport    rap;
  1686. ***************
  1687. *** 195,204 ****
  1688.   Rapport        *rpprt;
  1689.   {
  1690.       if (code >= 0)
  1691. !         fprintf(stdout, "Rapport : '%s' '%s' '%d'\n", rpprt->title,
  1692.               rpprt->author, rpprt->date);
  1693.       else
  1694. !         fprintf(stdout, "Return code = %d\n", code);
  1695.   }
  1696.   
  1697.   static int
  1698. --- 208,217 ----
  1699.   Rapport        *rpprt;
  1700.   {
  1701.       if (code >= 0)
  1702. !         fprintf(stdout, "Rapport : '%s' '%s' '%d'\\n", rpprt->title,
  1703.               rpprt->author, rpprt->date);
  1704.       else
  1705. !         fprintf(stdout, "Return code = %d\\n", code);
  1706.   }
  1707.   
  1708.   static int
  1709. ***************
  1710. *** 226,281 ****
  1711.           return(l1LT2);    /* key1 < key2 */
  1712.   }
  1713.   .fi
  1714. - .sp 2
  1715. - This example program produces the following output :
  1716. - .nf
  1717. -     lGetNode
  1718. -     Rapport : 'Book 2' 'More People' '890130'
  1719. -     Rapport : 'Book 1' 'People' '890129'
  1720. -     Rapport : 'Book 3' 'Lots of People' '890131'
  1721. -     Return code = -9
  1722. -     lGetIndxNode
  1723. -     Return code = -13
  1724. -     Rapport : 'Book 1' 'People' '890129'
  1725. -     Return code = -13
  1726. -     Rapport : 'Book 3' 'Lots of People' '890131'
  1727. -     lFndNode
  1728. -     Rapport : 'Book 2' 'More People' '890130'
  1729. -     Rapport : 'Book 3' 'Lots of People' '890131'
  1730. -     Return code = -10
  1731. -     lDump : 0
  1732. -     lUndump : 1
  1733. -     Rapport : 'Book 4' 'The Author' '891127'
  1734. -     Rapport : 'Book 2' 'More People' '890130'
  1735. -     Rapport : 'Book 1' 'People' '890129'
  1736. -     Rapport : 'Book 3' 'Lots of People' '890131'
  1737. -     Return code = -9
  1738. -     lFndFlagNode
  1739. -     Rapport : 'Book 1' 'People' '890129'
  1740. -     Rapport : 'Book 3' 'Lots of People' '890131'
  1741. -     Rapport : 'Book 2' 'More People' '890130'
  1742. -     Return code = -10
  1743. -     Untouched list
  1744. -     Rapport : 'Book 4' 'The Author' '891127'
  1745. -     Rapport : 'Book 2' 'More People' '890130'
  1746. -     Rapport : 'Book 1' 'People' '890129'
  1747. -     Rapport : 'Book 3' 'Lots of People' '890131'
  1748. -     Return code = -9
  1749. -     lSort
  1750. -     Rapport : 'Book 4' 'The Author' '891127'
  1751. -     Rapport : 'Book 1' 'People' '890129'
  1752. -     Rapport : 'Book 2' 'More People' '890130'
  1753. -     Rapport : 'Book 3' 'Lots of People' '890131'
  1754. -     Return code = -9
  1755. -     lSort
  1756. -     Rapport : 'Book 3' 'Lots of People' '890131'
  1757. -     Rapport : 'Book 2' 'More People' '890130'
  1758. -     Rapport : 'Book 1' 'People' '890129'
  1759. -     Rapport : 'Book 4' 'The Author' '891127'
  1760. -     Return code = -9
  1761. - .fi
  1762.   .SH VERSION
  1763. ! Generic Linked List 0.8, March 1993.
  1764.   .SH PUBLIC DOMAIN
  1765.   The Generic Linked List package is in the public domain. If you have
  1766.   any comments, suggestions, or find any bugs, or make any changes you'd
  1767. --- 239,246 ----
  1768.           return(l1LT2);    /* key1 < key2 */
  1769.   }
  1770.   .fi
  1771.   .SH VERSION
  1772. ! Generic Linked List 0.9, May 1993.
  1773.   .SH PUBLIC DOMAIN
  1774.   The Generic Linked List package is in the public domain. If you have
  1775.   any comments, suggestions, or find any bugs, or make any changes you'd
  1776. *** ../Doc/lDef.3    Fri Feb 26 10:30:43 1993
  1777. --- Doc/lDef.3    Thu May 27 12:01:53 1993
  1778. ***************
  1779. *** 27,32 ****
  1780. --- 27,33 ----
  1781.       lDOUBLY    doubly linked list, each node points to the previous and
  1782.           the next node
  1783.   .fi
  1784. + .sp 1
  1785.   \fIcc\fP :
  1786.   .nf
  1787.       lCHAIN    chain linked list, last node has a NULL-pointer
  1788. *** ../Doc/lFndFlagNode.3    Fri Feb 26 10:38:09 1993
  1789. --- Doc/lFndFlagNode.3    Thu May 27 12:01:53 1993
  1790. ***************
  1791. *** 5,11 ****
  1792.   lFndFlagNode - Get node by flag.
  1793.   .SH SYNOPSIS
  1794.   int
  1795. ! .BR "lFndFlagNode" "(id, from, flag, data, size)"
  1796.   .br
  1797.   .RT
  1798.   .RP
  1799. --- 5,11 ----
  1800.   lFndFlagNode - Get node by flag.
  1801.   .SH SYNOPSIS
  1802.   int
  1803. ! .BR "lFndFlagNode" "(id, which, flag, data, size)"
  1804.   .br
  1805.   .RT
  1806.   .RP
  1807. ***************
  1808. *** 12,18 ****
  1809.   In    int    id    identifier of linked list
  1810.   .br
  1811.   .RP
  1812. ! In    int    from    from where must be searched
  1813.   .br
  1814.   .RP
  1815.   In    int    flag    flag of node which must be retrieved
  1816. --- 12,18 ----
  1817.   In    int    id    identifier of linked list
  1818.   .br
  1819.   .RP
  1820. ! In    int    which    from which node must be searched and in which direction
  1821.   .br
  1822.   .RP
  1823.   In    int    flag    flag of node which must be retrieved
  1824. ***************
  1825. *** 25,47 ****
  1826.   .DT
  1827.   .SH DESCRIPTION
  1828.   \fBlFndFlagNode\fP searches a 'flagged' node from the linked list. From
  1829. ! where the node must be searched can be specified by \fIfrom\fP. A node
  1830. ! can be searched forward from the beginning of the list or from the
  1831. ! current node and backward from the current node or from the end of the
  1832. ! list.
  1833.   .br
  1834.   Backward searching is only possible for doubly linked list.
  1835.   .br
  1836.   When the found node is the first or the last node, the return code will
  1837.   have the value lFIRST or lLAST, otherwise lFOUND.
  1838.   .SH PARAMETER DEFINITIONS
  1839.   .if t .ta 0.2i 1.5i
  1840. ! \fIfrom\fP :
  1841.   .nf
  1842. !     lFIRST    search forward from first node
  1843. !     lPREVIOUS    search backward from previous node
  1844. !     lNEXT    search forward from next node
  1845. !     lLAST    search backward from last node
  1846.   .fi
  1847.   .SH RETURN CODES
  1848.   .nf
  1849. --- 25,51 ----
  1850.   .DT
  1851.   .SH DESCRIPTION
  1852.   \fBlFndFlagNode\fP searches a 'flagged' node from the linked list. From
  1853. ! which node the searching must start and in which direction must be
  1854. ! searched can be specified by \fIwhich\fP. A node can be searched forward
  1855. ! from the beginning of the list (lFIRST) or from the current node (lNEXT)
  1856. ! and backward from the end of the list (lLAST) or from the current node
  1857. ! (lPREVIOUS).
  1858.   .br
  1859.   Backward searching is only possible for doubly linked list.
  1860.   .br
  1861.   When the found node is the first or the last node, the return code will
  1862.   have the value lFIRST or lLAST, otherwise lFOUND.
  1863. + When the linked list contains only one node, the return code will have
  1864. + the value lFIRST, when searching backward, and the value lLAST, when
  1865. + searching forward.
  1866.   .SH PARAMETER DEFINITIONS
  1867.   .if t .ta 0.2i 1.5i
  1868. ! \fIwhich\fP :
  1869.   .nf
  1870. !     lFIRST    search forward starting from the first node
  1871. !     lNEXT    search forward starting from the next node
  1872. !     lLAST    search backward starting from the last node
  1873. !     lPREVIOUS    search backward starting from the previous node
  1874.   .fi
  1875.   .SH RETURN CODES
  1876.   .nf
  1877. ***************
  1878. *** 48,54 ****
  1879.   Return on success :
  1880.       lFOUND, lFIRST, lLAST, lNOT_FOUND
  1881.   Return on error :
  1882. !     lUNKNOWN_ID, lEMPTY_LIST, lWRONG_FROM, lSIZE_NE
  1883.   .fi
  1884.   .SH AUTHOR
  1885.   Anita Eijs (TNO - Bouw - BouwInformatica)
  1886. --- 52,58 ----
  1887.   Return on success :
  1888.       lFOUND, lFIRST, lLAST, lNOT_FOUND
  1889.   Return on error :
  1890. !     lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lSIZE_NE
  1891.   .fi
  1892.   .SH AUTHOR
  1893.   Anita Eijs (TNO - Bouw - BouwInformatica)
  1894. *** ../Doc/lFndNode.3    Fri Feb 26 10:47:50 1993
  1895. --- Doc/lFndNode.3    Thu May 27 12:01:53 1993
  1896. ***************
  1897. *** 5,11 ****
  1898.   lFndNode - Find node.
  1899.   .SH SYNOPSIS
  1900.   int
  1901. ! .BR "lFndNode" "(id, from, func, ptr, data, size)"
  1902.   .br
  1903.   .RT
  1904.   .RP
  1905. --- 5,11 ----
  1906.   lFndNode - Find node.
  1907.   .SH SYNOPSIS
  1908.   int
  1909. ! .BR "lFndNode" "(id, which, func, ptr, data, size)"
  1910.   .br
  1911.   .RT
  1912.   .RP
  1913. ***************
  1914. *** 12,18 ****
  1915.   In    int    id    identifier of linked list
  1916.   .br
  1917.   .RP
  1918. ! In    int    from    from where must be searched
  1919.   .br
  1920.   .RP
  1921.   In    int    (*func)()    function for checking the data on conditions
  1922. --- 12,18 ----
  1923.   In    int    id    identifier of linked list
  1924.   .br
  1925.   .RP
  1926. ! In    int    which    from which node must be searched and in which direction
  1927.   .br
  1928.   .RP
  1929.   In    int    (*func)()    function for checking the data on conditions
  1930. ***************
  1931. *** 28,55 ****
  1932.   .DT
  1933.   .SH DESCRIPTION
  1934.   \fBlFndNode\fP searches a node from the linked list, using the user
  1935. ! defined serach function \fIfunc\fP, which checks the data of a node
  1936.   on conditions. This function must have two parameters, a pointer to
  1937.   the data to compare with and a pointer to the data of a node. The
  1938.   possible return values are lFOUND or lNOT_FOUND. See the introduction
  1939.   of Generic Linked List for an example of such a search function. From
  1940. ! where the node must be searched can be specified by \fIfrom\fP. A node
  1941. ! can be searched forward from the beginning of the list or from the
  1942. ! current node and backward from the current node or from the end of the
  1943. ! list.
  1944.   .br
  1945.   Backward searching is only possible for doubly linked list.
  1946.   .br
  1947.   When the found node is the first or the last node, the return code will
  1948.   have the value lFIRST or lLAST, otherwise lFOUND.
  1949.   .SH PARAMETER DEFINITIONS
  1950.   .if t .ta 0.2i 1.5i
  1951. ! \fIfrom\fP :
  1952.   .nf
  1953. !     lFIRST    search forward from first node
  1954. !     lPREVIOUS    search backward from previous node
  1955. !     lNEXT    search forward from next node
  1956. !     lLAST    search backward from last node
  1957.   .fi
  1958.   .SH RETURN CODES
  1959.   .nf
  1960. --- 28,59 ----
  1961.   .DT
  1962.   .SH DESCRIPTION
  1963.   \fBlFndNode\fP searches a node from the linked list, using the user
  1964. ! defined search function \fIfunc\fP, which checks the data of a node
  1965.   on conditions. This function must have two parameters, a pointer to
  1966.   the data to compare with and a pointer to the data of a node. The
  1967.   possible return values are lFOUND or lNOT_FOUND. See the introduction
  1968.   of Generic Linked List for an example of such a search function. From
  1969. ! which node the searching must start and in which direction must be
  1970. ! searched can be specified by \fIwhich\fP. A node can be searched
  1971. ! forward from the beginning of the list (lFIRST) or from the current
  1972. ! node (lNEXT) and backward from the end of the list (lLAST) or from
  1973. ! the current node (lPREVIOUS).
  1974.   .br
  1975.   Backward searching is only possible for doubly linked list.
  1976.   .br
  1977.   When the found node is the first or the last node, the return code will
  1978.   have the value lFIRST or lLAST, otherwise lFOUND.
  1979. + When the linked list contains only one node, the return code will have
  1980. + the value lFIRST, when searching backward, and the value lLAST, when
  1981. + searching forward.
  1982.   .SH PARAMETER DEFINITIONS
  1983.   .if t .ta 0.2i 1.5i
  1984. ! \fIwhich\fP :
  1985.   .nf
  1986. !     lFIRST    search forward starting from the first node
  1987. !     lNEXT    search forward starting from the next node
  1988. !     lLAST    search backward starting from the last node
  1989. !     lPREVIOUS    search backward starting from the previous node
  1990.   .fi
  1991.   .SH RETURN CODES
  1992.   .nf
  1993. ***************
  1994. *** 58,64 ****
  1995.   Return on error :
  1996.   .fi
  1997.   .in +0.2i
  1998. ! lUNKNOWN_ID, lEMPTY_LIST, lWRONG_FROM, lUNKNOWN_FUNC, lNOT_DOUBLY
  1999. ! .in 10.2i
  2000.   .SH AUTHOR
  2001.   Anita Eijs (TNO - Bouw - BouwInformatica)
  2002. --- 62,68 ----
  2003.   Return on error :
  2004.   .fi
  2005.   .in +0.2i
  2006. ! lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lNOT_DOUBLY, lUNKNOWN_FUNC
  2007. ! .in -0.2i
  2008.   .SH AUTHOR
  2009.   Anita Eijs (TNO - Bouw - BouwInformatica)
  2010. *** ../Doc/lGetNode.3    Fri Feb 26 10:43:42 1993
  2011. --- Doc/lGetNode.3    Thu May 27 12:01:53 1993
  2012. ***************
  2013. *** 29,34 ****
  2014. --- 29,37 ----
  2015.   When the retrieved node is the first or the last node, the return code
  2016.   will have the value lFIRST or lLAST. For the other nodes the routine
  2017.   returns lSUCCESS.
  2018. + When the linked list contains only one node, the return code will have
  2019. + the value lFIRST, when retrieving backward, and the value lLAST, when
  2020. + retrieving forward.
  2021.   .SH PARAMETER DEFINITIONS
  2022.   .if t .ta 0.2i 1.5i
  2023.   \fIwhich\fP :
  2024. ***************
  2025. *** 45,52 ****
  2026.       lSUCCESS, lFIRST, lLAST
  2027.   Return on error :
  2028.   .fi
  2029. ! .in +02.i
  2030. ! lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lEOL, lNOT_DOUBLY, lSIZE_NE
  2031. ! .in -02.i
  2032.   .SH AUTHOR
  2033.   Anita Eijs (TNO - Bouw - BouwInformatica)
  2034. --- 48,55 ----
  2035.       lSUCCESS, lFIRST, lLAST
  2036.   Return on error :
  2037.   .fi
  2038. ! .in +0.2i
  2039. ! lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lEOL, lSIZE_NE, lNOT_DOUBLY
  2040. ! .in -0.2i
  2041.   .SH AUTHOR
  2042.   Anita Eijs (TNO - Bouw - BouwInformatica)
  2043. *** ../Doc/lInfoNode.3    Fri Feb 26 10:44:07 1993
  2044. --- Doc/lInfoNode.3    Thu May 27 12:01:53 1993
  2045. ***************
  2046. *** 44,50 ****
  2047.   Return on error :
  2048.   .fi
  2049.   .in +0.2i
  2050. ! lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lEOL, lNOT_DOUBLY
  2051.   .in -0.2i
  2052.   .SH AUTHOR
  2053.   Anita Eijs (TNO - Bouw - BouwInformatica)
  2054. --- 44,50 ----
  2055.   Return on error :
  2056.   .fi
  2057.   .in +0.2i
  2058. ! lUNKNOWN_ID, lEMPTY_LIST, lWRONG_WHICH, lNOT_DOUBLY, lEOL
  2059.   .in -0.2i
  2060.   .SH AUTHOR
  2061.   Anita Eijs (TNO - Bouw - BouwInformatica)
  2062. *** ../Doc/lSort.3    Mon Apr 19 13:49:00 1993
  2063. --- Doc/lSort.3    Thu May 27 12:01:53 1993
  2064. ***************
  2065. *** 15,21 ****
  2066.   .RP
  2067.   In    int    theory    sorting theory
  2068.   .RP
  2069. ! In    int    (*func)()    function for comparing the data of 2 nodes
  2070.   .DT
  2071.   .SH DESCRIPTION
  2072.   \fBlSort\fP sorts a linked list in the specified \fIorder\fP, using
  2073. --- 15,21 ----
  2074.   .RP
  2075.   In    int    theory    sorting theory
  2076.   .RP
  2077. ! In    int    (*func)()    function for comparing the data of two nodes
  2078.   .DT
  2079.   .SH DESCRIPTION
  2080.   \fBlSort\fP sorts a linked list in the specified \fIorder\fP, using
  2081. ***************
  2082. *** 31,43 ****
  2083.       lASCENDING    'a', 'b', 'c', ...
  2084.       lDESCENDING    'z', 'y', 'x', ...
  2085.   .fi
  2086.   \fItheory\fP :
  2087.   .nf
  2088. !     lBUBBLE    bubble sorting algorithm ...
  2089. !     lHEAP    heap sorting algorithm ...
  2090. !     lINSERT    insert sorting algorithm ...
  2091. !     lQUICK    quick sorting algorithm ...
  2092. !     lSELECTION    selection sorting algorithm ...
  2093.   .fi
  2094.   .SH RETURN CODES
  2095.   .nf
  2096. --- 31,44 ----
  2097.       lASCENDING    'a', 'b', 'c', ...
  2098.       lDESCENDING    'z', 'y', 'x', ...
  2099.   .fi
  2100. + .sp 1
  2101.   \fItheory\fP :
  2102.   .nf
  2103. !     lBUBBLE    bubble sorting algorithm
  2104. !     lHEAP    heap sorting algorithm
  2105. !     lINSERT    insert sorting algorithm
  2106. !     lQUICK    quick sorting algorithm
  2107. !     lSELECTION    selection sorting algorithm
  2108.   .fi
  2109.   .SH RETURN CODES
  2110.   .nf
  2111.